package com.xfz.Controller;

import com.xfz.User.Supplier;
import com.xfz.common.Res;
import com.xfz.service.SupplierService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/supplier")
public class SupplierController {
    @Autowired
    SupplierService supplierService;
    //查询商家
    @GetMapping("/suppliers")
    public Res getSuppliers() {
        List<Supplier> suppList = supplierService.findAllSuppliers();
        if(suppList!=null){
            return new Res(1, "成功", suppList);
        } else {
            return new Res(0, "失败");
        }

    }
}
